<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.ArrayList"%>
<%@ page import="com.wap.framework.model.TestModel;"%>
<%
String path = request.getContextPath();

String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">    
    <title>index</title>
	<script type="text/javascript" src="<%=path%>/public/js/jquery-1.4.2.js"></script>
  </head>
  <body>
  	<table id="tab">
  		<form id="fm">
			<div><input type="text" name="a" value="1" id="a" /></div>
			<div><input type="text" name="b" value="2" id="b" /></div>
			<div><input type="hidden" name="c" value="3" id="c" /></div>  				
  		</form>
  		<% 
  			List data = new ArrayList();
  			TestModel tm = new TestModel();
  			tm.setId(1);
  			tm.setName("nandy1");
  			data.add(tm);
  			
  			TestModel _tm = new TestModel();
  			_tm.setId(2);
  			_tm.setName("nandy2");
  			data.add(_tm);
  			String params = "";
  			for(int i = 0; i < data.size(); i++) {
  				TestModel tm2 = (TestModel) data.get(i);
  				params += "Id="+tm2.getId();
  				if(i < data.size() - 1)
  					params += "&";
  		%>  			
  			<tr id="arr">
  				<td>
  					<a title="<%=tm2.getName()%>"><%=tm2.getName()%><div name="vt<%=tm2.getId()%>" id="<%=tm2.getId()%>"></div></a>
  				</td>
  			</tr>
  		<%
  			}
  			out.println("<script type='text/javascript'>");
  			out.println("alert($('#fm').serializeArray());");
  			out.println("$.ajax({url:'/wap4mobile/ajaxPost.do',type:'POST',data:'Id=1&Id=2',success:function(msg){alert(msg);}});");
  			out.println("</script>");
  		%>
  	</table>
  </body>
</html>
